<?php
if(isset($_POST['save']) && !empty($_POST['save'])){	
	echo "<pre>";print_r($_POST);echo "</pre>";
}
if(isset($_POST['value']) && !empty($_POST['value'])){
	echo $_POST['value'];die;
	//echo "<pre>";print_r($_POST);echo "</pre>";
}

?>
<html>
<head>
<script src="js/dynamicform.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.jeditable.js"></script>


<script type="text/javascript" charset="utf-8">

$(function() {	
	  $(".editable_textarea").editable("index.php", { 
	      indicator : "<img src='img/indicator.gif'>",
	      type   : 'textarea',
	      submitdata: { _method: "put" },
	      select : true,
	      submit : 'OK',
	      cancel : 'cancel',
	      cssclass : "editable",
	      autogrow : {
	          lineHeight : 16,
	          minHeight  : 32
	       }
	  });
	});

</script>

<style type="text/css">
#sidebar {
  width: 0px;
}

#content {
  width: 770px;
}

.editable input[type=submit] {
  color: #F00;
  font-weight: bold;
}
.editable input[type=button] {
  color: #0F0;
  font-weight: bold;
}
.editable_textarea{
	margin-bottom:0px;
}
</style>
</head>
<body>
<fieldset>
<legend>Demo</legend>
<form method="post" name="myForm" action="">
<div id="dynamicInputs">

</div>
<select name="inputSelect">
<option value="text">text field</option>
<option value="radio">radio button</option>
<option value="checkbox">checkbox</option>
<option value="textarea">textarea</option>
</select>
<input type="button" onclick="addAllInputs('dynamicInputs', document.myForm.inputSelect.value);" value="Add selected input">
<input type="submit" name="save" value="Save" />
</form>
</fieldset>
</body>
</html>